import java.io.IOException;

import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.LocalDevice;
import javax.microedition.io.Connector;
import javax.microedition.io.StreamConnection;
import javax.microedition.io.StreamConnectionNotifier;


public class Server extends NetworkPlayer {

	public Server() {
		super(null);
	}

	public void start(ConnectionListener l) throws IOException {
		LocalDevice device = LocalDevice.getLocalDevice();
		device.setDiscoverable(DiscoveryAgent.GIAC);
	
		String url = "btspp://localhost:" + "F0E0D0C0B0A000908070605040302011" + ";name=DeviceServerCOMM";

		StreamConnectionNotifier notifier = (StreamConnectionNotifier) Connector.open(url);
	
		StreamConnection connection = notifier.acceptAndOpen();
		
		m_Connection = new Connection(connection);
		m_Connection.setAutoFlush(false);
		l.clientConnected(this);
	}

}
